package com.electronic.modules.revoke.param;

import com.alibaba.fastjson.JSONObject;
import com.electronic.domain.CebsSdkProperties;
import com.electronic.valid.BeanValidator;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @Author: IFCA
 * @Description: 获取撤章二维码扫码状态
 */

@Data
public class QRCodeScannedStatusDTO {


    /**
     * 二维码唯一标识
     */
    @NotBlank(message = "tid不能为空")
    private String tid;

    /**
     * 初始化CA信息
     */
    @NotNull(message = "初始化CA信息不能为空")
    private CebsSdkProperties cebsSdkProperties;
    public static QRCodeScannedStatusDTO parse(String businessData){
        QRCodeScannedStatusDTO dto = JSONObject.parseObject(businessData, QRCodeScannedStatusDTO.class);
        //验证必填项
        BeanValidator.validateReturnException(dto);
        return dto;
    }
}
